#ifndef HASH_TABLE_H
#define HASH_TABLE_H
#include "string.h"
#include "stdlib.h"

typedef struct vm_hash_table_block {
    char key[256];
    void* value;
    int hash_code;
    struct vm_hash_table_block* next;
} vm_hash_table_block;

typedef struct vm_hash_table {
    vm_hash_table_block** data;
    int count;
    int capacity;
} vm_hash_table;

vm_hash_table* hash_init(int capacity);
int hash_key(vm_hash_table* hash_table, const char* key);
int hash_add(vm_hash_table* hash_table, char* key, void* element, int size_of_element);
int hash_contains(vm_hash_table* hash_table, char* key);
vm_hash_table_block* hash_find(vm_hash_table* hash_table, char* key);
void hash_remove(vm_hash_table* hash_table, char* key);
void hash_destroy(vm_hash_table* hash_table);

#endif